from typing import Optional


def _main():
    input_list: list[int] = eval(input("nums = "))

    changed = False

    pre_last: Optional[int] = None
    last: Optional[int] = None
    for current in input_list:
        if last is None or last <= current:
            pre_last = last
            last = current
            continue

        if changed:
            print("false")
            return

        changed = True
        if pre_last is None or pre_last <= current:
            # 可以降低前者，则降低前者到再前者的大小
            # last = pre_last

            # pre_last = last
            last = current
        else:
            # 降低前者无用，则升高后者直到前者的大小
            # current = last

            pre_last = last
            # last = current
            pass

    print("true")


if __name__ == "__main__":
    _main()
